Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Update Methods

This section describes renderer update methods.

TQ3XRendererUpdateStyleMethod

#define kQ3XMethodTypeRendererUpdateStyleMetaHandler
                     Q3_METHOD_TYPE ('r','d','y','u')
typedef TQ3XFunctionPointer
                     (*TQ3XRendererUpdateStyleMetaHandlerMethod)(
                     TQ3ObjectType    styleType);
typedef TQ3Status (*TQ3XRendererUpdateStyleMethod)(
                     TQ3ViewObject    view,
                     void             *rendererPrivate,
                     const void       *publicData);
styleType
A style object type (see "Q3Style_GetType" ).
view
The current view being rendered to.
rendererPrivate
A pointer to structure of size instanceSize , passed into Q3ObjectHierarchy_RegisterClass , and initialized in your kQ3MethodTypeObjectNew method.
publicData
A pointer the public data structure associated with a style. You may retain a copy of the pointer passed to you and use it to access the state. The state remains valid until either another update on this style type is made at this depth or a pop action occurs. A push action does not invalidate the pointer.

DESCRIPTION

The method type kQ3XMethodTypeRendererUpdateStyleMetaHandler returns a function pointer of type TQ3XRendererUpdateStyleMetaHandlerMethod. This function enables a style of type styleType and returns methods of type TQ3XRendererUpdateStyleMethod.

The types of the data structures pointed to by publicData corresponds to the style types shown in the following table:

Style type

Data structure type

kQ3StyleTypeBackfacing

TQ3BackfacingStyle *

kQ3StyleTypeInterpolation

TQ3InterpolationStyle *

kQ3StyleTypeFill

TQ3FillStyle *

kQ3StyleTypePickID

unsigned long *

kQ3StyleTypeReceiveShadows

TQ3Boolean *

kQ3StyleTypeHighlight

TQ3AttributeSet *

kQ3StyleTypeSubdivision

TQ3SubdivisionStyleData *

kQ3StyleTypeOrientation

TQ3OrientationStyle *

kQ3StyleTypePickParts

TQ3PickParts *

kQ3StyleTypeAntiAlias

TQ3AntiAliasStyleData

TQ3XRendererUpdateAttributeMethod

#define kQ3XMethodTypeRendererUpdateAttributeMetaHandler
                     Q3_METHOD_TYPE ('r','d','a','u')
typedef TQ3XFunctionPointer
                     (*TQ3XRendererUpdateAttributeMetaHandlerMethod)(
                     TQ3AttributeType    attributeType);
typedef TQ3Status (*TQ3XRendererUpdateAttributeMethod)(
                     TQ3ViewObject    view,
                     void             *rendererPrivate,
                     const void       *publicData);
attributeType
An attribute object type (see "Types of Attributes and Attribute Sets" ).
view
The current view being rendered to.
rendererPrivate
A pointer to structure of size instanceSize , passed into Q3ObjectHierarchy_RegisterClass , and initialized in your kQ3MethodTypeObjectNew method.
publicData
A pointer the public data structure associated with an attribute object. You may retain a copy of the pointer passed to you and use it to access the state. The state remains valid until either another update on this attribute type is made at this depth or a pop action occurs. A push action does not invalidate the pointer.

DESCRIPTION

The method type kQ3XMethodTypeRendererUpdateAttributeMetaHandler returns a function pointer of type TQ3XRendererUpdateAttributeMetaHandlerMethod. This function enables an attribute of type attributeType and returns methods of type TQ3XRendererUpdateAttributeMethod.

The types of the data structures pointed to by publicData corresponds to the attribute types shown in the following table:

Attribute type

Data structure type

kQ3AttributeTypeAmbientCoefficient

float *

kQ3AttributeTypeDiffuseColor

TQ3ColorRGB *

kQ3AttributeTypeNormal

TQ3Vector3D *

kQ3AttributeTypeSpecularColor

TQ3ColorRGB *

kQ3AttributeTypeSpecularControl

float *

kQ3AttributeTypeTransparencyColor

TQ3ColorRGB *

kQ3AttributeTypeSurfaceShader

TQ3ShaderObject *

TQ3XRendererUpdateShaderMethod

#define kQ3XMethodTypeRendererUpdateShaderMetaHandler
                     Q3_METHOD_TYPE ('r','d','s','u')
typedef TQ3XFunctionPointer
                     (*TQ3XRendererUpdateShaderMetaHandlerMethod)(
                     TQ3ObjectType    shaderType);
typedef TQ3Status (*TQ3XRendererUpdateShaderMethod)(
                     TQ3ViewObject     view,
                     void              *rendererPrivate,
                     TQ3ShaderObject    *shaderObject);
shaderType
A shader object type (see "Q3Shader_GetType" ).
view
The current view being rendered to.
rendererPrivate
A pointer to structure of size instanceSize , passed into Q3ObjectHierarchy_RegisterClass , and initialized in your kQ3MethodTypeObjectNew method.
shaderObject
A shader object. A shaderObject pointer is never NULL . The pointer to it, *shaderObject , may be NULL ; this value disables that particular type of shader. Generally, a renderer should retain a reference obtained from Q3Shared_GetReference to a non- NULL * shaderObject pointer and use it to shade any subsequently rendered objects.

DESCRIPTION

The method type kQ3XMethodTypeRendererUpdateShaderMetaHandler returns a function pointer of type TQ3XRendererUpdateShaderMetaHandlerMethod. This function enables a shader of type shaderType and returns methods of type TQ3XRendererUpdateShaderMethod.

The surface shader state may be overridden by a non- NULL surface shader attribute state. Do not depend on these states being updated in any particular order.

TQ3XRendererUpdateMatrixMethod

#define kQ3XMethodTypeRendererUpdateMatrixMetaHandler
                     Q3_METHOD_TYPE ('r','d','x','u')
typedef TQ3XMetaHandler TQ3XRendererUpdateMatrixMetaHandlerMethod;
typedef TQ3Status (*TQ3XRendererUpdateMatrixMethod) (
                     TQ3ViewObject         view,
                     void                  *rendererPrivate,
                     const TQ3Matrix4x4    *matrix);
view
The current view being rendered to.
rendererPrivate
A pointer to structure of size instanceSize , passed into Q3ObjectHierarchy_RegisterClass , and initialized in your kQ3MethodTypeObjectNew method.
matrix
A pointer to a matrix.

DESCRIPTION

TQ3XRendererUpdateMatrixMetaHandlerMethod switches on the following types of methods and returns methods of type TQ3XRendererUpdateMatrixMethod:

#define kQ3XMethodTypeRendererUpdateMatrixLocalToWorld
                     Q3_METHOD_TYPE ('u','l','w','x')
#define kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse
                     Q3_METHOD_TYPE ('u','l','w','i')
#define kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose
                     Q3_METHOD_TYPE ('u','l','w','t')
#define kQ3XMethodTypeRendererUpdateMatrixLocalToCamera
                     Q3_METHOD_TYPE ('u','l','c','x')
#define kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum
                     Q3_METHOD_TYPE ('u','l','f','x')
#define kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum
                     Q3_METHOD_TYPE ('u','w','f','x')

Matrix update methods are called in the order shown in the foregoing list.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |